﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TR.Domain.Entity;
using TR.Domain.Repository;

namespace TR.EFCore.Repository
{
    public class CsRepository:ICsRepository
    {
        private readonly MyContext myContext;

        public CsRepository(MyContext myContext) 
        {
            this.myContext = myContext;
        }

        public async Task<bool> CsAdd(Cs cs)
        {
            myContext.Cs.Add(cs);
            return await myContext.SaveChangesAsync() > 0 ? true : false;
        }

        public Task<List<Cs>> CsSelete()
        {
            return myContext.Cs.ToListAsync();
        }

        public Task<rbac_User> LoginUser(rbac_User ru)
        {
            throw new NotImplementedException();
        }
    }
}
